<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html{
            perspective: 800px;
        }
        body{
            border: 1px red solid;
            background-color: solid;
        }
        .box1{
            width: 200px;
            height: 200px;
            margin: 0 auto;
            background-color: #bfa;
            transition: 2s;
        }
        body:hover .box1{
            /* 
                通过旋转可以使元素沿着x y 或z旋转指定的角度
                rotateX()
                rotateY()
                rotateZ()
            */
            /* transform: rotateZ(45turn); */
            /* transform: rotateX(90deg); */
            transform: rotateZ(45deg) ;

            /* 是否显示元素的背面 */
            backface-visibility: hidden;
        }
    </style>
</head>
<body>
    <div class="box1"></div>  
</body>
</html>